import Cookies from 'js-cookie'


/**
 * 设置cookies
 * @param {*} key cookies名称
 * @param {*} value cookies值
 * @param {*} expires 过期时间，单位秒,默认43200秒，即12小时
 */
function setCookies(key,value,expires=43200){
	let time = new Date(new Date() * 1 + expires * 1000);
	Cookies.set(key, value, { expires: time });
}
// 在mian.js中全局引入
export default  {
	get: key => Cookies.get(key),
	// set: (key,value) => Cookies.set(key, value),
	set:setCookies,
	remove: key => Cookies.remove(key)
}
